package com.magicmovie.service;

import com.magicmovie.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
public interface UserService {

    @RequestMapping(value = "/user/findByUsername",method = RequestMethod.GET)
    User findByUserName(@RequestParam("username") String username);

    @RequestMapping(value = "/user/insert",method = RequestMethod.POST)
    void insert(@RequestBody User user);

    @RequestMapping(value = "/user/update",method = RequestMethod.POST)
    void update(@RequestBody User user);

    @RequestMapping(value = "/user/findByParams",method = RequestMethod.POST)
    List<Map<String,Object>> findByParams(@RequestBody Map<String,Object> params);

    @RequestMapping(value = "/user/findByPrimaryKey",method = RequestMethod.GET)
    User findByPrimaryKey(@RequestParam("id") Integer id);

    @RequestMapping(value = "/user/delete",method = RequestMethod.GET)
    void delete(@RequestParam("id") Integer id);
}
